package com.relax;


import com.relax.applicationContext.TomcatAnnotationConfigApplicationContext;
import com.relax.bean.Person;
import com.relax.bean.RainBow;
import com.relax.circularDependency.BService;
import com.relax.config.MainConfig;
import com.relax.config.MainConfig2;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

public class TomcatSpringApplicationDemo {
    public static void main(String[] args) {

        /**
         * 使用注解方法
         */
        TomcatAnnotationConfigApplicationContext context = new TomcatAnnotationConfigApplicationContext(MainConfig.class);
        Person p = (Person) context.getBean("person1");
        System.out.println(p);


    }



}
